/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mrroman.linksender.gui;

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;

import com.mrroman.linksender.ioc.Name;

/**
 *
 * @author mrozekon
 */
@Name("gui.ClipboardUtils")
public class ClipboardUtils implements ClipboardOwner {

    public void lostOwnership(Clipboard clipboard, Transferable contents) {

    }

    public void copyText(String text) {
        StringSelection stringSelection = new StringSelection( text );
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        clipboard.setContents( stringSelection, this );
    }
    
}
